﻿using Loki.Utils;
using NUnit.Framework;

namespace Luna.Connectors.Google.Test
{
    [TestFixture]
    public class ContactTest : AssertionHelper
    {
        public IConnector Connector
        {
            get
            {
                return ToolKit.Engine.GetDataModel<TestDataModel>().Get<IConnector>(ConnectorType.Google.ToString());
            }
        }

        [Test]
        public void TestCategory()
        {
            Connector.Configure(TestSettings.Correct);
            //var temp = Connector.Contacts;
            //int i = temp.CategoryGetAll().Count();
            //foreach (var L_Group in temp.CategoryGetAll())
            //{
            //    Console.WriteLine(string.Format("{0} {1} {2}", L_Group.Name.Length, L_Group.Name, L_Group.GoogleLastUpdate));
            //}
        }

        [Test]
        public void TestGet()
        {
            Connector.Configure(TestSettings.Correct);
            //var temp = Connector.Contacts;
            //int i = temp.ContactGetAll().Count<IContactData>();
        }

        [Test]
        public void TestInvalidCredentials()
        {
            Connector.Configure(TestSettings.Invalid);
            Expect(Connector.Enabled, Is.False);
        }
    }
}